home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 112 / EnigmaAmiga112CD.iso / dalla rivista / awnpipe / contributi / aweblastpages / install-alp < prev    next >
Text File  |  2000-02-04  |  6KB  |  209 lines

  1. ; $VER: 'Install-LastPages' 3.2 (05/Jan/00)
  2. ; Written By Bruce Steers <bsteers@btinternet.com>
  3. ; Description: Installer for AWebLastPages.awebrx Plugin
  4.  
  5. (set v39 (>= (/ (getversion "exec.library" (resident)) 65536) 39))
  6. (set #needInst43 "You must use Installer version 43 or greater.  Use the Installer program from your AWeb-II disk.")
  7. (set #needAWeb33 "You must have AWeb-II version 3.3 or greater.\nAnd the Assign AWeb3: made\n\nif you are a registered AWeb User then goto the AWeb homepage to download the AWeb3.3 upgrade patch.")
  8. (set srcdir (pathonly @icon))
  9.  
  10. (if (< (/ @installer-version 65536) 43)
  11.   (abort #needInst43)
  12. )
  13.  
  14. (set vernum (getversion "AWeb3:AWeb-II"))
  15. (set webv (/ vernum 65536))
  16. (set webr (- vernum (* webv 65536) ) )
  17.  
  18.   (set pv (getversion "env:AWeb3/LastPage.cfg"))
  19.   (set prfv (/ pv 65536))
  20.   (set prfr (- pv (* prfv 65536) ) )
  21.  
  22.   (set av (getversion "AWebLastPages.awebrx"))
  23.   (set alpv (/ av 65536))
  24.   (set alpr (- av (* alpv 65536) ) )
  25.  
  26. (if (< webv 3)  (if (< webr 3) (abort #needAWeb33) ) )
  27.  
  28. (welcome "Welcome to Bruces\nAWebLastPages "alpv"."alpr" Installation Utility")
  29.  
  30. ;------------------install/update the AWNPipe-handler-----------------
  31.  
  32. (set lv (getversion "l:awnpipe-handler"))
  33. (set nv (getversion "awnp/l/awnpipe-handler"))
  34.  (if (> nv lv)
  35.    (copylib
  36.    (source "awnp/l/awnpipe-handler")
  37.    (dest "l:")
  38.    (prompt "Installing AWNPipe-handler")
  39.    (help "This Will Install AWNPipe-handler to L:")
  40.    (confirm)
  41.    )
  42.    (copylib
  43.    (dest "Devs:dosdrivers")
  44.    (source "awnp/DosDrivers/awnpipe")
  45.    (prompt "Installing AWebNews Pipe:")
  46.    (help "This Will Install the AWNPipe Descriptor File to Devs:DosDrivers")
  47.    (infos)
  48.    )
  49.  (run "C:assign AWNPipe: dismount")
  50.  (run "C:mount AWNPipe:")
  51.  )
  52.  
  53. ;--------------Check versions of env:AWeb3/LastPage.cfg----------------
  54.  
  55.   (if (exists "env:AWeb3/LastPage.cfg")
  56.  
  57.     (if (< pv av)
  58.       (if
  59.         (askbool
  60.         (default 1)
  61.         (prompt "\nThe Configuration file for ALP V"prfv"."prfr"\nwas found in ENV:\n\nthis will need to be deleted\nfor the newer Version "alpv"."alpr"\nIs This OK ?")
  62.         (help "The configuration file has changed and is not compatible with this version ,\nSO you must delete the old one.")
  63.         )
  64.       (run "delete force >nil: env:AWeb3/LastPage.cfg envarc:AWeb3/LastPage.cfg")
  65.       )
  66.     )
  67.   )
  68.  
  69.  
  70. (set #installing "Installing ")
  71. ; offer to back up a file or drawer
  72. (procedure bumprev #bumpfile #bumptxt
  73.   (if (exists #bumpfile)
  74.     (
  75.       (set bump 1)
  76.       (while (exists (cat #bumpfile "_old" bump) ) (set bump (+ bump 1)) )
  77.       (if
  78.         (askbool
  79.           (default 1)
  80.           (prompt (cat "\n\n\nBackup " #bumpfile " as "
  81.               #bumpfile "_old" bump " ?\n\n\n "
  82.           #bumptxt ) )
  83.           (help
  84.             (cat "\n\n\n\"" #bumpfile "\" is about to be Altered.\n"
  85.               "\nYou are being given the chance to back it up."
  86.               " If you are unsure select yes... just in case!\n"
  87.               " you can delete the backup if all goes well ;-D ."
  88.             )
  89.           )
  90.         )
  91.         ;        (rename #bumpfile (cat #bumpfile "_old" bump))
  92.         ( (set bdest (cat #bumpfile "_old" bump))
  93.           (copyfiles
  94.             (source #bumpfile)
  95.             (dest bdest)
  96.             (all)
  97.           )
  98.         )
  99.       )
  100.     )
  101.   )
  102. )
  103.  
  104. ;add a line to a settings file
  105.  
  106. (procedure addpref #preffile #preftext
  107.   (foreach "ENVARC:AWeb3" "~(program|browser|gui|network|window|settings)"
  108.     (
  109.       (if (= @each-type 2)
  110.         (run (cat "echo >>ENVARC:AWeb3/" @each-name "/" #preffile " \"" #preftext  "\"") )
  111.       )
  112.     )
  113.   )
  114.   (run (cat "echo >>ENVARC:AWeb3/" #preffile " \"" #preftext  "\"") )
  115. )
  116.  
  117. (set #no-aweb-ii
  118.   (cat "You must have completed the AWeb-II 3.3 installation before "
  119.     "you can install the %s plug-in. No AWeb3: assign has been found."
  120.   )
  121. )
  122. (if (not (exists "AWeb3:" (noreq)))
  123.   (abort (#no-aweb-ii "Utilities"))
  124. )
  125.  
  126. (set @default-dest "AWeb3:")
  127. (bumprev "envarc:aweb3"
  128.   (cat "Your previously SAVED AWeb 3.3 configuration"
  129.   " is in this directory.")
  130. ) ; backup any previous AWeb3 prefs
  131.  
  132.  
  133.  
  134. (set menbut
  135.   (askoptions
  136.     (prompt "\nInstallation Method For how\n"
  137.     "AWebLastPages should be executed.\n\n"
  138.     "If you have already installed ALP then\n"
  139.     "do not select anything\n:^)")
  140.  
  141.     (help "The GUI buttons appear on the main AWeb window\n"
  142.           "\(with settings-GUI-options-show user buttons on\)\n"
  143.           "OR.. the Toolbar User menu.\n"
  144.           "\nThe ARexx menu is attached to the main AWeb window\n"
  145.           "\nBe sure to check settings for duplicate entries if\n"
  146.           "this is not your first installation and you set something here.\n\n:^)"
  147.     )
  148.  
  149.      (choices "        A GUI Button: \"ALP\""
  150.               "        A GUI Button: \"LastPages\""
  151.               " An ARexx Menu Entry: \"LastPages\"" )
  152. (default 0)
  153.   )
  154. )
  155. (if(bitand 1 menbut)
  156.  (if(bitand 2 menbut)=0
  157.  (addpref "gui" "UBUT ALPRUN AWeb3:Plugins/AWebLastPages.awebrx")
  158.  )
  159. )
  160.  (if(bitand 2 menbut)
  161.  (addpref "gui" "UBUT LastPagesRUN AWeb3:Plugins/AWebLastPages.awebrx")
  162. )
  163. (if(bitand 3 menbut)
  164. (addpref "gui" "AREX 0;AWeb3:Plugins/AWebLastPages.awebrx;LastPages")
  165. )
  166.  
  167. (copyfiles
  168.   (source "AWebLastPages.awebrx")
  169.   (dest (tackon @default-dest "Plugins"))
  170. )
  171. (copyfiles
  172.    (source srcdir)
  173.    (choices "AWebLastPages.html" "AWebLastPages.html.info")
  174.    (dest "AWeb3:Docs")
  175.    (infos)
  176. )
  177.  
  178. (delete "env:aweb3/#?" (all))
  179.  
  180. (copyfiles
  181.   (source "ENVARC:AWeb3")
  182.   (dest "ENV:AWeb3")
  183.   (all)
  184. )
  185.  
  186. (complete 99)
  187.  
  188. (if
  189.    (askbool
  190.       (prompt "Run AWebLastPages")
  191.       (help "This will run the command\nrx aweb3:Plugins/AWebLastPages.awebrx")
  192.       (default 1)
  193.    )
  194.    (
  195.       (run "run >nil: sys:rexxc/rx aweb3:Plugins/AWebLastPages.awebrx")
  196.    )
  197. )
  198.  
  199. (set @default-dest (expandpath "AWeb3:Plugins"))
  200.  
  201. (complete 100)
  202.  
  203. (exit  "\n\n" @app-name
  204.   " "alpv"."alpr" is now installed.\n\n"
  205.   "If this is an update instalation be sure to check your GUI "
  206. " settings for duplicate entries."
  207. "\n"
  208. )
  209.